﻿@model PagedList.IPagedList<Model.users>
@using PagedList.Mvc;

@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    ViewBag.Title = "用户权限";
}

<table class="table">
    <tr>
        <th>
            用户名
        </th>
        <th>
            昵称
        </th>
        <th>
            性别
        </th>
        <th>
            头像
        </th>
        <th>
            生日
        </th>
        <th>
            个人简介
        </th>
        <th>
            积分
        </th>
        <th>
            状态
        </th>
        <th>
            操作
        </th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.userName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.nickName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.userSex)
            </td>
            <td style="display:inline-block;" height="74px;">
                <img width="74px;" src="~/Content/images/@item.userImage" alt="Alternate Text" />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Birthday)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.userDesc)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.credit)
            </td>
            <td>
                @if (item.nowState == 1)
                {
                    <span style="width:55px;display:inline-block;">正常</span>
                }
                else
                {
                    <span style="width:55px;display:inline-block;">封禁</span>
                }
            </td>
            <td>
                @Html.ActionLink("封禁/解封", "KillUser", new { id = item.ID })
            </td>
        </tr>
    }

</table>
@Html.PagedListPager(Model, page => Url.Action("UserPower", "Admin", new { page = page }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new PagedListRenderOptions { LinkToFirstPageFormat = "首页", LinkToLastPageFormat = "尾页", MaximumPageNumbersToDisplay = 5 }, new AjaxOptions { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "manager-wrapper" }))

@section css{
    <link href="~/Content/css/PagedList.css" rel="stylesheet" />
    <link href="~/Content/css/GoodsClassicationPatialView.css" rel="stylesheet" />
}